import traceback

from selenium.webdriver.chrome.webdriver import WebDriver

from models.book import BookInfo
from spider.platform.imooc import IMOOC


def sync_article(driver: WebDriver, book_info: BookInfo):
    try:
        if book_info.imooc == 0:
            imooc = IMOOC(driver)
            imooc.sync_article(book_info)
    except Exception as e:
        traceback.print_exc()
